package com.edu.cloud.facade.feign;

import com.edu.cloud.center.api.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(
        name = "httpapi",
        url = "${edu.cloud.center.host}",
        path = "${edu.cloud.center.path}",
        contextId = "IHttpApi"
)
public interface IHttpApi {

    @GetMapping({"/hello"})
    String hello();

    @GetMapping({"/echo"})
    String echo(@RequestParam String str);

    @GetMapping({"/echo1s"})
    String echo1s(@RequestParam String str) throws InterruptedException;

    @GetMapping({"/echo2s"})
    String echo2s(@RequestParam String str) throws InterruptedException;

    @GetMapping({"/echo3s"})
    String echo3s(@RequestParam String str) throws InterruptedException;

    @GetMapping({"/echo2"})
    String echo2(@RequestParam("name") String str1, @RequestParam("age") String str2);

    @PostMapping({"/echoPost"})
    String echoPost(@RequestParam("name") String str1, @RequestParam("age") String str2);

    @PostMapping({"/echoPostPojo"})
    String echoPostPojo(@RequestBody User u);
}
